<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021-03-16
 * Time: 9:12
 */

namespace app\cms\admin;
use app\cms\model\CmsArticle;
use app\system\admin\Admin;
use think\Db;
use think\Request;

class Article extends Admin
{
    protected $hisiModel = 'CmsArticle';//模型名称[通用添加、修改专用]
    protected $hisiTable = '';//表名称[通用添加、修改专用]
    protected $hisiAddScene = '';//添加数据验证场景名
    protected $hisiEditScene = '';//更新数据验证场景名

    public function article()
    {
        if ($this->request->isAjax()) {
            $where  = $data = [];
            $page   = $this->request->param('page/d', 1);
            $limit  = $this->request->param('limit/d', 15);

            $data['data']   = Db::table("hisi_cms_article")->select();
            $data['count']  = Db::table("hisi_cms_article")->where($where)->count('id');
            $data['code']   = 0;
            return json($data);
        }
        return $this->fetch();
    }
}